<template>
  <div class="f">
    <el-container style="height: 100%;">
      <el-header>
        <div>
          <img src="../../assets/logo2.svg" width="80px" style="margin:12px" />
          <h3>闲置二手发布平台</h3>
        </div>
        <div>{{uname}}</div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu class="hovernone">
            <el-menu-item index="1-1" class="fabu">
              <button class="xianwubutton" @click="goFabu">发布商品</button>
            </el-menu-item>
            <div class="tleft">
              <!-- <el-menu-item index="1-2">商品数据</el-menu-item> -->
              <el-menu-item index="1-1" @click="goTG">商品管理</el-menu-item>
              <el-menu-item index="1-1">发布须知</el-menu-item>
            </div>
          </el-menu>
        </el-aside>
        <el-container>
          <el-main>
            <router-view></router-view>
          </el-main>
          <!-- <el-footer></el-footer> -->
        </el-container>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data(){
    return {
      uname:sessionStorage.getItem("userName")
    }
  },
  methods: {
    goFabu() {
      if (this.$route.path !== "/fabu") {
        this.$router.push("/fabu");
      }
    },
      goTG(){
        if (this.$route.path !== "/tg") {
        this.$router.push("/tg");
      }
      }
  }
};
</script>

<style lang="less" scoped>

.el-menu-item.is-active {
  color: black;
}
.el-menu-item{
  color: black;
}
.el-menu-item:hover {
  background: none;
}
.el-menu-item:focus{
  background: none;
  color: rgb(244, 175, 26)
  // color: rgb(255, 174, 0);
} 
.f {
  background-color: rgb(238, 241, 248);
 
  height: 100%;
}
.fabu {
  box-sizing: border-box;
  border: none;

  border-top: 1px solid #e4e4e4;
  border-bottom: 1px solid #e4e4e4;
}
.el-header {
  background: white;
  display: flex;
  justify-content: space-between;
  //   color: #e0d7d7;
  > div {
    display: flex;
    align-items: center;
    span {
      margin-left: 15px;
    }
  }
}
.tleft {
  text-align: left;
  padding: 1px 12px;
}
.xianwubutton {
  width: 100%;
  height: 37px;
  border-radius: 4px;
}
.el-menu {
  height: 100%;
  background-color: white;
  .el-menu {
    border-right: none;
  }
}

.el-container {
}
.ce {
  position: absolute;
  left: 30%;
  right: 50%;
  width: 500px;
}
</style>
